﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace Xin478.CSWork.Client
{
    public partial class Form1 : MyForm
    {
        public Form1()
        {
            InitializeComponent();
        }
    }

    public class MyScrollBar : VScrollBar
    {
        public MyScrollBar()
            : base()
        {
            base.SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.ResizeRedraw |
                ControlStyles.SupportsTransparentBackColor, true);
            base.UpdateStyles();
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Rectangle rect = e.ClipRectangle;
            using(SolidBrush sb=new SolidBrush(Color.FromArgb(244,247,250)))
            {
                g.FillRectangle(sb, rect);
            }

            Rectangle r1=new Rectangle(1,1,this.Width-2,this.Width-2);
            Pen borderPen =new Pen( Color.FromArgb(186, 199, 219));            
            using (SolidBrush sb = new SolidBrush(Color.FromArgb(245, 248, 252)))
            {
                g.FillRectangle(sb, r1);
            }
            g.DrawRectangle(Pens.White, r1);

            r1.Offset(-1, -1);
            g.DrawRectangle(borderPen, r1);

            borderPen.Dispose();
        }
    }

    public class MyButton : Button
    {

    }
}
